package com.wxmit.module.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.wxmit.framework.satoken.core.util.StpUserUtil;
import com.wxmit.module.system.domain.workbench.QuickLink;
import com.wxmit.module.system.mapper.QuickLinkMapper;
import com.wxmit.module.system.service.IQuickLinkService;
import com.wxmit.system.base.core.ShushanPage;
import com.wxmit.system.base.core.ShushanServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 快捷操作Service业务层处理
 * 
 * @author xiong
 * @date 2022-09-07
 */
@Service
public class QuickLinkServiceImpl extends ShushanServiceImpl<QuickLinkMapper, QuickLink> implements IQuickLinkService
{

    @Autowired
    private QuickLinkMapper quickLinkMapper;

    @Override
    public IPage<QuickLink> listPage(ShushanPage<QuickLink> page, QuickLink searchData) {
        LambdaQueryChainWrapper<QuickLink> quickLinkLambdaQueryChainWrapper = lambdaQuery();
      //TODO::: 查询参数
        return   quickLinkLambdaQueryChainWrapper.page(page);
    }

    @Override
    public IPage<QuickLink> listByPage(ShushanPage<QuickLink> page, QuickLink searchData ) {
        searchData.setCreateBy(StpUserUtil.getLoginUser().getUsername());
        return  quickLinkMapper.listByPage(page,searchData);
    }

    @Override
    public boolean add(QuickLink quickLink) {
        return save(quickLink);
    }

    @Override
    public boolean edit(QuickLink quickLink) {
        return updateById(quickLink);
    }

    @Override
    public boolean deleteByIds(List<Long> ids) {
        return removeByIds(ids);
    }


}